#include <stdio.h>
int x; //定义全局变量x
int f();
int main()
{
    int a = 1;

    x = a;   //对全局变量x赋值1
    a = f(); //a的值为4
    {
        int b = 2;
        b = a + b;
        x = x + b; //全局变量运算
    }
    printf("%d  %d", a, x);

    return 0;
}
int f()
{
    int x = 4; //x为局部变量，全局函数x不起作用

    return x;
}